package com.jumi.microservice.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jumi.microservice.common.base.AbstractObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 部门值对象
 *
 * @author Administrator
 */
@ApiModel(value="DepartmentVO值对象", description="DepartmentVO值对象")
public class DepartmentVO extends AbstractObject implements Serializable {

    @ApiModelProperty(value = "部门主键id")
    private Long id;

    @ApiModelProperty(value = "部门名称")
    @NotNull(message = "部门名称不能为空!")
    @Length(max = 10,message = "部门名称长度不能超过10个字符")
    private String departmentName;

    @ApiModelProperty(value = "排序")
    @Range(min = 0,max = 999, message = "排序的取值范围0-999")
    private Integer orderNum;

    @ApiModelProperty(value = "状态，1启用，0.禁用")
    private Integer status;

    @ApiModelProperty(value = "是否删除(0:否,1:是)")
    private Integer isDel;

    @ApiModelProperty(value = "父部门ID")
    private Long parentId;

    @ApiModelProperty(value = "父部门名称")
    @TableField(exist = false)
    private String parentDepartmentName;

    @ApiModelProperty(value = "添加人")
    private String creater;

    @ApiModelProperty(value = "添加时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String modifier;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @JsonIgnore
    @ApiModelProperty(value = "添加开始时间")
    private String startTimeAdd;

    @JsonIgnore
    @ApiModelProperty(value = "添加结束时间")
    private String endTimeAdd;

    @JsonIgnore
    @ApiModelProperty(value = "修改开始时间")
    private String startTimeUp;

    @JsonIgnore
    @ApiModelProperty(value = "修改结束时间")
    private String endTimeUp;

    @ApiModelProperty(value = "子菜单列表")
    List<DepartmentVO> children;

    public List<DepartmentVO> getChildren() {
        return children;
    }

    public void setChildren(List<DepartmentVO> children) {
        this.children = children;
    }

    public String getStartTimeAdd() {
        return startTimeAdd;
    }

    public void setStartTimeAdd(String startTimeAdd) {
        this.startTimeAdd = startTimeAdd;
    }

    public String getEndTimeAdd() {
        return endTimeAdd;
    }

    public void setEndTimeAdd(String endTimeAdd) {
        this.endTimeAdd = endTimeAdd;
    }

    public String getStartTimeUp() {
        return startTimeUp;
    }

    public void setStartTimeUp(String startTimeUp) {
        this.startTimeUp = startTimeUp;
    }

    public String getEndTimeUp() {
        return endTimeUp;
    }

    public void setEndTimeUp(String endTimeUp) {
        this.endTimeUp = endTimeUp;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getParentDepartmentName() {
        return parentDepartmentName;
    }

    public void setParentDepartmentName(String parentDepartmentName) {
        this.parentDepartmentName = parentDepartmentName;
    }

    @Override
    public String toString() {
        return "DepartmentVO{" +
                "id=" + id +
                ", departmentName='" + departmentName + '\'' +
                ", orderNum=" + orderNum +
                ", status=" + status +
                ", isDel=" + isDel +
                ", parentId=" + parentId +
                ", parentDepartmentName='" + parentDepartmentName + '\'' +
                ", creater='" + creater + '\'' +
                ", createTime=" + createTime +
                ", modifier='" + modifier + '\'' +
                ", updateTime=" + updateTime +
                ", startTimeAdd='" + startTimeAdd + '\'' +
                ", endTimeAdd='" + endTimeAdd + '\'' +
                ", startTimeUp='" + startTimeUp + '\'' +
                ", endTimeUp='" + endTimeUp + '\'' +
                ", children=" + children +
                '}';
    }
}
